package pl.edu.agh.io.fx3.filesystem.disk;

import java.io.File;

import pl.edu.agh.io.fx3.filesystem.FileSystem;
import pl.edu.agh.io.fx3.filesystem.FileSystemFactory;
import pl.edu.agh.io.fx3.monitor.IFile;
import pl.edu.agh.io.fx3.monitor.VFSFile;
import pl.edu.agh.io.fx3.saver.dao.FileUtilsDAO;
import pl.edu.agh.io.fx3.treecreator.disk.DiskTreeCreator;

public class DiskFileSystem implements FileSystem {

	private DiskTreeCreator treeCreator;
	private FileUtilsDAO dao;
	
	public DiskFileSystem(File file, FileUtilsDAO dao, DiskTreeCreator treeCreator) {
		this.dao = dao;
			
		this.treeCreator = treeCreator;
		FileSystemFactory.LOGGER.debug("New DiskFileSystem instance created.");
	}
	
	public IFile getIFile(String pathname) {
		FileSystemFactory.LOGGER.debug("Obtaining implementation of IFile interface.");
		return new VFSFile(pathname, treeCreator, dao, this);
	}
}
